.TH std::ranges::split_view::base 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ranges::split_view::base \- std::ranges::split_view::base

.SH Synopsis
   constexpr V base() const& requires std::copy_constructible<V>; \fB(1)\fP \fI(since C++20)\fP
   constexpr V base() &&;                                         \fB(2)\fP \fI(since C++20)\fP

   Returns a copy of the underlying view base_.

   1) Copy constructs the result from the underlying view.
   2) Move constructs the result from the underlying view.

.SH Parameters

   \fI(none)\fP

.SH Return value

   1) A copy of the underlying view.
   2) A view move-constructed from the underlying view.

.SH Example


// Run this code

 #include <iomanip>
 #include <iostream>
 #include <ranges>
 #include <string_view>

 int main()
 {
     constexpr std::string_view keywords{"this throw true try typedef typeid"};
     std::ranges::split_view split_view{keywords, ' '};
     std::cout << "base() = " << std::quoted(split_view.base()) << "\\n"
                  "substrings: ";
     for (auto split : split_view)
         std::cout << std::quoted(std::string_view{split}) << ' ';
     std::cout << '\\n';
 }

.SH Output:

 base() = "this throw true try typedef typeid"
 substrings: "this" "throw" "true" "try" "typedef" "typeid"

   Defect reports

   The following behavior-changing defect reports were applied retroactively to
   previously published C++ standards.

      DR    Applied to            Behavior as published              Correct behavior
   LWG 3590 C++20      the const& overload additionally required    constraints relaxed
                       validity of copy-assignment

.SH See also

   base    returns a copy of the underlying (adapted) view
   (C++20) \fI(public member function of std::ranges::lazy_split_view<V,Pattern>)\fP
